﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage.Master"
CodeBehind="wfTRegistroRpt.aspx.cs" Inherits="RH.wfTRegistroRpt" %>
<%@ Import Namespace="Texfina.Common.Mg" %>
<%@ Import Namespace="Texfina.Core.Common" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
 <script type="text/javascript">
     window.onload = function () {
         this.ResizeGrid(); 
         this.MessageOnPostback();
     }

     function ResizeGrid() {
         internalGridResize("<%= grdList.ClientID %>");
     }

     function panelOnUpdating() {
         updatePanelAnimationUpdating();
     }

     function panelOnUpdated() {
         ResizeGrid();
         updatePanelAnimationUpdated();
     }

     function isEmptyCheckBox() {
         var gv = document.getElementById("<%=grdList.ClientID%>");
         var rbs = gv.getElementsByTagName("input");
         var count = 0;
         for (var i = 0; i < rbs.length; i++) {
             if (rbs[i].type == "checkbox") {
                 if (rbs[i].checked == true) {
                     count++;
                 }
             }
         }
         if (count == 0) {
             alert("Seleccione una opcion para exportar");
             return false;
         }

         return true;
     }

     function validateGridCommands(key, rowIndex) {
         var row = getGridRowByIndex('<%= grdList.ClientID %>', rowIndex);

         if (getObjInnerText(row.cells[parseInt('<%=_GRDLIST_STEXPORTA %>')]) == '<%=ConstFlagEstado.ACTIVADO %>') {
             alert('Esta opcion no se encuentra habilitada.');
             return false;
         }

         return true;
     }

 </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="ToolBar">
      <asp:Menu ID="mnuToolbar" CssClass="ToolBarControl" runat="server" Orientation="Horizontal" OnMenuItemClick="mnuToolbar_MenuItemClick">
         <Items>
            <asp:MenuItem Text="  Exportar EXCEL" Value="_BTTEXPO" ImageUrl="../Images/Icons/Enabled/ExportXLS.png">
            </asp:MenuItem>
         </Items>
      </asp:Menu>
    </div>
      <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <div class="DataHeader">
         <table id="TableDataHeader" cellpadding="0" cellspacing="0">
            <tr><td colspan="11" >&nbsp;</td></tr>
            <tr>
               <td style=" width:10px;" >             
                  &nbsp;
               </td>
               <td>
                 Mes
               </td>
               <td colspan="8">
                 <asp:DropDownList runat="server" ID="ddlidMes" width="200px">
                 </asp:DropDownList> 
               </td>
               <td style=" width:10px;" >
                  &nbsp;
               </td>
            </tr>
            <tr><td colspan="11" >&nbsp;</td></tr>
         </table>
    </div>
    <div class="DataDetail">
           <esd:esdGridView CssClass="esdGridView" ID="grdList" runat="server" ScrollWidth="100%"
            Width="100%" ShowHeaderWhenEmpty="True" AutoGenerateColumns="False" DataKeyNames="idTRegistro"
            OnRowDataBound="grdList_RowDataBound" OnRowCommand="grdList_RowCommand">
            <Columns>
                <asp:TemplateField HeaderText="Sel.">
                   <ItemTemplate>
                      <asp:CheckBox ID="chkSelected" runat="server" Checked="false" />
                   </ItemTemplate>
                   <HeaderStyle Width="22px" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton ID="grdBttCmdPrev" CommandName="CmdPrev" CommandArgument="<%# Container.DataItemIndex %>"
                            runat="server" ImageUrl="../Images/Icons/Enabled/Sunat.png" ToolTip="Exportar" OnDataBinding="grdBttCmdPrevPostBackDataBinding" />
                    </ItemTemplate>
                    <HeaderStyle Width="22px" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:TemplateField>
                <asp:BoundField DataField="idTRegistro" HeaderText="Codigo"></asp:BoundField>
                <asp:BoundField DataField="dsTRegistro" HeaderText="Descripcion"></asp:BoundField>
                <asp:BoundField DataField="stExporta" HeaderStyle-CssClass="hideDataGridColumn"
                ItemStyle-CssClass="hideDataGridColumn"></asp:BoundField>
                <asp:BoundField DataField="dsNombreArchivo" HeaderStyle-CssClass="hideDataGridColumn"
                ItemStyle-CssClass="hideDataGridColumn"></asp:BoundField>

                
            </Columns>
            <EmptyDataTemplate>
                <div id="gridempty">
                    <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />
                    &nbsp;No existen registros para esta solicitud.
                </div>
            </EmptyDataTemplate>
        </esd:esdGridView>
    </div>
     <asp:HiddenField ID="hdnMsgOPB" runat="server" />
     </ContentTemplate> 
</asp:UpdatePanel>
<ajax:UpdatePanelAnimationExtender ID="upae" BehaviorID="animation" runat="server"
    TargetControlID="updatePanel1">
    <animations>
        <OnUpdating>
        <Parallel duration="0.5">
            <ScriptAction Script="panelOnUpdating();" />  
        </Parallel>
        </OnUpdating>
        <OnUpdated>
        <Parallel duration="0.5">
            <ScriptAction Script="panelOnUpdated();" /> 
        </Parallel> 
        </OnUpdated>
    </animations>
</ajax:UpdatePanelAnimationExtender>
<div id="updateProgressDiv" class="updateProgress" style="display: none">
        <table width="100%">
            <tr>
                <td valign="middle">
                    <img src="../Images/Controls/Loading.gif" />
                </td>
                <td valign="middle">
                    <span class="updateProgressMessage">Cargando ...</span>
                </td>
            </tr>
        </table>
</div>
</asp:Content>